<style lang="scss" scoped>
#cmain{
    .mainContent{
        min-height:425px;
        border-radius:10px;
        background:#fff;
        box-shadow:0px 0px 15px 0px rgba(207,207,207,1);
        padding-top:10px;
        padding:0px 30px;
        .risk-header{
            height: 54px;
            line-height:54px;
            padding-top:21px;
            padding-bottom:10px;
            border-bottom:1px solid #ccc;
            .person-detail{
                color:#666;
                font-weight:normal;
                height: 23px;
                line-height:23px;
                float:left;
                b{
                    padding:0px 10px;
                    border-right:1px solid #666;
                    &:nth-last-child(1){
                        border-right:0;
                    }
                }
            }
            .save-button{
                float: right;
                margin-bottom:-10px;
                padding-top:6px;
                padding-bottom:6px;
            }
        }
        .risk-content{
            padding-bottom:20px;
            margin-top:30px;
            .risk-block{
                margin:17px 0;
                .risk-block-title{
                    font-size:18px;
                    color:#337AB7;
                    font-family: "Roboto";
                }
                .risk-familyTree{
                    margin-top:10px;
                    height: 573px;
                    border:1px solid #DCDFE6;
                }
                .risk-block-content{
                    padding:20px 0;
                    .genetic-content{
                        padding:10px 0;
                        .genetic-row{
                            padding:5px 0;
                        }
                    }
                    .genetest-content{
                        padding:20px 0;
                        .genetest-row{
                            padding:5px 0;
                        }
                    }
                }
                .reference-list{
                    border:1px solid #ebeef5;
                    border-top:0;
                    padding:5px 0;
                    p{
                        line-height:30px;
                        margin:0;
                    }
                }
            }
            //遗传风险评估
            .risk-syndrome{
                margin:20px 0;
                border-top:1px solid #ccc;
                border-left:1px solid #ccc;
                .el-row{
                    .el-col{
                        padding:10px !important;
                    }
                    border-right:1px solid #ccc !important;
                    border-bottom:1px solid #ccc !important;
                    .el-col-14{
                        border-left:1px solid #ccc !important;
                        .stage{
                            line-height:30px;
                        }
                        .fontWeight800{
                            font-weight:800;
                        }
                        .fontWeight500{
                            font-weight:500;
                        }
                        .secondStage{
                            text-indent:1em;
                            .thirdStage{
                                text-indent:2em;
                            }
                        }
                    }
                }
            }
        }
    }
}
</style>

<template>
    <div id = "cmain">
        <div class="mainContent">
            <div class="risk-header">
                <p class="person-detail">
                    <!-- <b>家系ID:<span v-text="person.familyTreeId"></span></b> -->
                    <b>姓名:<span v-text="person.name"></span></b>
                    <b>性别:<span v-text="person.sex"></span></b>
                    <!-- <b>年龄:<span v-text="person.age"></span></b> -->
                </p>
                <el-button class="save-button" size="small" @click="saveGeneTicRisk" v-if="!isReadOnly" type="primary">保存</el-button>
            </div>
            <div class="risk-content">
                <!--家系图-->
                <div class="risk-block">
                    <div class="risk-block-title">家系图</div>
                    <div class="risk-familyTree">
                        <family :hiddenDom="hiddenDom"></family>
                    </div>
                </div>
                <!--家族史统计表-->
                <div class="risk-block">
                    <div class="risk-block-title">家族史统计表</div>
                    <el-table :data="tableData" border>
                        <el-table-column label="姓名" prop="name"></el-table-column>
                        <el-table-column label="亲属级别" prop="kinshipLevel"></el-table-column>
                        <el-table-column label="谱系" prop="pedigree"></el-table-column>
                        <el-table-column label="癌种"  prop="cancer"></el-table-column>
                        <el-table-column label="诊断年龄" prop="age"></el-table-column>
                        <el-table-column label="基因突变">
                            <template slot-scope="scope">
                                <p v-if="scope.row.genes" v-for="(item,index) in scope.row.genes" :key="index">{{item.detection_result_gene}}</p>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <!--遗传风险评估-->
                <div class="risk-block">
                    <div class="risk-block-title">遗传风险评估</div>
                    <div class="risk-block-content">
                        <p v-if="!syndromeModels">您的家族史信息不足，请进一步收集并进行遗传咨询!</p>
                        <el-row v-if="syndromeModels">
                            <el-col style="margin-top:10px;" :span="2">遗传风险：</el-col>
                            <el-col style="margin-top:10px;" :span="8">{{syndromeRisk}}</el-col>
                        </el-row>
                        <div v-if="syndromeModels" class="risk-syndrome" v-for="(item,index) in syndromeModels" :key="index">
                            <el-row type="flex" align="middle">
                                <el-col :span="6">1.遗传性肿瘤综合征判定</el-col>
                                <el-col :span="14">{{item.syndromeName}}</el-col>
                            </el-row>
                            <el-row type="flex" align="middle">
                                <el-col :span="6">2.遗传模式</el-col>
                                <el-col :span="14">{{item.geneticModel}}</el-col>
                            </el-row>
                            <el-row type="flex" align="middle">
                                <el-col :span="6">3.携带致病基因概率</el-col>
                                <el-col :span="14">{{item.mutation}}</el-col>
                            </el-row>
                            <el-row type="flex" align="middle">
                                <el-col :span="6">4.判定依据</el-col>
                                <el-col :span="14">
                                    <div v-if="item.descriptions && item.descriptions.length>0">
                                        <div :class="first.bExist? 'firstStage stage fontWeight800':'firstStage stage fontWeight500'" v-for="(first,f) in item.descriptions" :key="f">{{f+1}}.{{first.name}}
                                            <div v-if="first.descriptions && first.descriptions.length>0">
                                                <div :class="second.bExist? 'secondStage stage fontWeight800':'secondStage stage fontWeight500'" v-for="(second,s) in first.descriptions" :key="s">{{letterList[s]}}.{{second.name}}
                                                    <div v-if="second.descriptions && second.descriptions.length>0">
                                                        <div :class="third.bExist? 'thirdStage stage fontWeight800':'thirdStage stage fontWeight500'"  v-for="(third,t) in second.descriptions" :key="t">({{t+1}}).{{third.name}}</div> 
                                                    </div>
                                                </div> 
                                            </div>
                                        </div>
                                    </div>
                                </el-col>
                            </el-row>
                        </div> 
                    </div>
                </div>
                <!--遗传风险评估结果-->
                <div class="risk-block">
                    <div class="risk-block-title">遗传风险评估结果</div>
                    <div class="risk-block-content">
                        <el-row>
                            <el-col style="margin-top:10px;" :span="2">遗传风险：</el-col>
                            <el-col v-if="!isReadOnly" :span="8">
                                <el-select v-model="evaluateRet.geneticRiskType">
                                    <el-option key="0" label="请选择风险类型" value=""></el-option>
                                    <el-option key="1" label="高风险" value="1"></el-option>
                                    <el-option key="2" label="中等风险" value="2"></el-option>
                                    <el-option key="3" label="低风险" value="3"></el-option>
                                </el-select>
                            </el-col>
                            <el-col style="margin-top:10px;" :span="8" v-if="isReadOnly">{{ evaluateRet.geneticRiskType | getGeneticRiskType }}</el-col>
                        </el-row>
                        <div class="genetic-content" :key="index" v-for="(item,index) in evaluateRet.geneticRiskList">
                            <el-row class="genetic-row">
                                <el-col :span="4">1.遗传性肿瘤综合征判定</el-col>
                                <el-col v-if="!isReadOnly" :span="6">
                                    <el-input  size="small" v-model="item.geneJudge"></el-input>
                                </el-col>
                                <el-col v-if="isReadOnly" :span="6" v-text="item.geneJudge"></el-col>
                            </el-row>
                             <el-row class="genetic-row">
                                <el-col :span="4">2.遗传模式</el-col>
                                <el-col  v-if="!isReadOnly" :span="6">
                                    <el-select size="small" style="width:100%;" v-model="item.geneticMode">
                                        <el-option key="0" label="请选择风险类型" value=""></el-option>
                                        <el-option key="1" label="常染色体显性遗传" value="1"></el-option>
                                        <el-option key="2" label="常染色体隐性遗传" value="2"></el-option>
                                        <el-option key="3" label="X染色体连锁显性遗传" value="3"></el-option>
                                        <el-option key="4" label="X染色体连锁隐性遗传" value="4"></el-option>
                                        <el-option key="5" label="Y染色体连锁遗传" value="5"></el-option>
                                        <el-option key="6" label="复杂遗传模式" value="6"></el-option>
                                    </el-select>
                                </el-col>
                                <el-col  v-if="isReadOnly" :span="6">{{ item.geneticMode | getGeneticMode}}</el-col>
                                <el-col v-if="index>0 && !isReadOnly" style="float:right;" :span="4">
                                    <el-button @click="delet(index)"  type="danger" size="small">删除</el-button>
                                </el-col>
                            </el-row>
                            <el-row class="genetic-row">
                                <el-col :span="4">3.携带致病基因突变概率</el-col>
                                <el-col v-if="!isReadOnly" :span="6">
                                    <el-input size="small" v-model="item.geneticRate"></el-input>
                                </el-col>
                                <el-col v-if="isReadOnly" :span="6" v-text="item.geneticRate"></el-col>
                            </el-row> 
                        </div>
                        <el-row v-if="!isReadOnly">
                            <el-col>
                                <el-button type="primary" size="small" @click="addSyn">添加综合征</el-button>
                            </el-col>
                        </el-row>
                    </div>
                </div>
                <!--基因检测-->
                <div class="risk-block">
                    <div class="risk-block-title">基因检测：</div>
                    <div class="risk-block-content">
                        <el-row>
                            <el-col style="margin-top:10px;" :span="2">检测类型：</el-col>
                            <el-col v-if="!isReadOnly" :span="8">
                                <el-select v-model="geneTest.geneTestType">
                                    <el-option key="0" label="请选择检测类型" value=""></el-option>
                                    <el-option key="1" label="panel检测" value="1"></el-option>
                                    <el-option key="2" label="sanger测序" value="2"></el-option>
                                    <el-option key="3" label="MLPA" value="3"></el-option>
                                    <el-option key="4" label="全外显子" value="4"></el-option>
                                </el-select>
                            </el-col>
                            <el-col v-if="isReadOnly" style="margin-top:10px;" :span="8">{{ geneTest.geneTestType | getGeneTestType }}</el-col>
                        </el-row>
                        <div class="risk-block-title" style="margin-top:20px;">检测结果：</div>
                        <div class="genetest-content" :key="index" v-for="(item,index) in geneTest.geneTestList">
                            <el-row>
                                <el-col :span="7">
                                    <el-form style="width:80%;" label-position="right" label-width="100px"  :model="item" class="demo-form-inline">
                                        <el-form-item style="margin-bottom:0;" label="基因：">
                                            <el-input v-if="!isReadOnly" size="small" v-model="item.geneName"></el-input>
                                            <p v-if="isReadOnly" v-text="item.geneName"></p>
                                        </el-form-item>
                                        <el-form-item style="margin-bottom:0;" label="功能改变：">
                                            <el-select v-if="!isReadOnly" size="small"  style="width:100%;" v-model="item.funChange">
                                                <el-option key="0" label="请选择" value=""></el-option>
                                                <el-option key="1" label="错义突变" value="1"></el-option>
                                                <el-option key="2" label="无义突变" value="2"></el-option>
                                                <el-option key="3" label="移码突变" value="3"></el-option>
                                                <el-option key="4" label="同义突变" value="4"></el-option>
                                                <el-option key="5" label="剪接位点突变" value="5"></el-option>
                                                <el-option key="6" label="其他" value="6"></el-option>
                                            </el-select>
                                            <el-input v-if="!isReadOnly && item.funChange == '6'" size="small"  v-model="item.funOther"></el-input>
                                            <p v-if="isReadOnly && item.funChange != '6' ">{{ item.funChange | getFunCHange}}</p>
                                            <p v-if="isReadOnly && item.funChange == '6' " v-text="item.funOther"></p>
                                        </el-form-item>
                                    </el-form>
                                </el-col>
                                <el-col :span="7">
                                    <el-form style="width:80%;" label-position="right" label-width="100px" :model="item" class="demo-form-inline">
                                        <el-form-item style="margin-bottom:0;" label="转录本号：">
                                            <el-input v-if="!isReadOnly" size="small" v-model="item.ransNum"></el-input>
                                            <p v-if="isReadOnly" v-text="item.ransNum"></p>
                                        </el-form-item>
                                        <el-form-item label="突变类型：" style="margin-bottom:0;">
                                            <el-select  v-if="!isReadOnly" size="small" style="width:100%;" v-model="item.mutType">
                                                <el-option key="0" label="请选择" value=""></el-option>
                                                <el-option key="1" label="致病的" value="1"></el-option>
                                                <el-option key="2" label="可能致病的" value="2"></el-option>
                                                <el-option key="3" label="意义不明确的" value="3"></el-option>
                                                <el-option key="4" label="可能良性的" value="4"></el-option>
                                                <el-option key="5" label="良性的" value="5"></el-option>
                                            </el-select>
                                            <p v-if="isReadOnly">{{ item.mutType | getMutType}}</p>
                                        </el-form-item>
                                    </el-form>
                                </el-col>
                                <el-col :span="7">
                                    <el-form style="width:80%;" label-position="right" label-width="100px" :model="item" class="demo-form-inline">
                                        <el-form-item style="margin-bottom:0;" label="变异位点：">
                                            <el-input v-if="!isReadOnly" size="small" v-model="item.variationSite"></el-input>
                                            <p v-if="isReadOnly" v-text="item.variationSite"></p>
                                        </el-form-item>
                                    </el-form>
                                </el-col>
                                <el-col v-if="index>0 && !isReadOnly" style="float:right;" :span="2">
                                    <el-button @click="deletGeneTest(index)"  type="danger" size="small">删除</el-button>
                                </el-col>
                            </el-row>
                        </div>
                        <el-row v-if="!isReadOnly">
                            <el-col>
                                <el-button type="primary" size="small" @click="addgeneTest">添加检测结果</el-button>
                            </el-col>
                        </el-row>
                    </div>
                </div>
                <!--报告解读-->
                <div class="risk-block">
                    <div class="risk-block-title">报告解读</div>
                    <div class="risk-block-content">
                        <el-input v-if="!isReadOnly" type="textarea" :autosize="{ minRows: 3}" width="100%;" placeholder="多行输入" v-model="reportInterpre"></el-input>
                        <p v-if="isReadOnly" v-text="reportInterpre"></p>
                    </div>
                </div>
                <!--预防筛查建议-->
                <div class="risk-block">
                    <div class="risk-block-title">预防筛查建议</div>
                     <div class="risk-block-content">
                        <el-row v-if="!isReadOnly">
                            <el-col style="margin-top:10px;" :span="2">综合征类型：</el-col>
                            <el-col :span="8">
                                <el-select v-if="!isReadOnly" size="small" v-model="suggestionn.syndromeType" @change="changeSyType">
                                    <el-option key="0" label="请选择" value=""></el-option>
                                    <el-option key="1" label="遗传性乳腺癌卵巢癌综合征" value="1"></el-option>
                                    <el-option key="2" label="遗传性弥漫性胃癌" value="2"></el-option>
                                    <el-option key="3" label="李法美尼综合征" value="3"></el-option>
                                    <el-option key="4" label="黑斑性息肉病" value="4"></el-option>
                                    <el-option key="5" label="Cowden综合征" value="5"></el-option>
                                    <el-option key="6" label="家族性腺瘤性息肉病" value="6"></el-option>
                                    <el-option key="7" label="MYH相关性息肉病" value="7"></el-option>
                                    <el-option key="8" label="林奇综合征" value="8"></el-option>
                                    <el-option key="9" label="幼年性息肉病" value="9"></el-option>
                                    <el-option key="10" label="遗传性多发性黑色素瘤" value="10"></el-option>
                                    <el-option key="11" label="共济失调性毛细血管扩张症" value="11"></el-option>
                                    <el-option key="12" label="Bloom综合征" value="12"></el-option>
                                    <el-option key="13" label="锯齿状息肉病" value="13"></el-option>
                                    <el-option key="14" label="基底细胞痣样综合征" value="14"></el-option>
                                    <el-option key="15" label="遗传性前列腺癌" value="15"></el-option>
                                    <el-option key="16" label="Carney综合征" value="16"></el-option>
                                    <el-option key="17" label="多发性内分泌腺瘤病II型" value="17"></el-option>
                                    <el-option key="18" label="遗传性副神经节瘤" value="18"></el-option>
                                    <el-option key="19" label="甲状腺非髓样癌" value="19"></el-option>
                                    <el-option key="20" label="结节性硬化症" value="20"></el-option>
                                    <el-option key="21" label="成年早老症" value="21"></el-option>
                                    <el-option key="22" label="Birt–Hogg– Dubé综合征" value="22"></el-option>
                                    <el-option key="23" label="遗传性肾细胞癌与平滑肌瘤" value="23"></el-option>
                                    <el-option key="24" label="横纹肌样易感综合征" value="24"></el-option>
                                    <el-option key="25" label="VHL综合征" value="25"></el-option>
                                    <el-option key="26" label="遗传性乳头状肾细胞癌 " value="26"></el-option>
                                    <el-option key="27" label="神经纤维瘤病I型" value="27"></el-option>
                                </el-select>
                                <p style="margin-top:10px;" v-if="isReadOnly">{{ suggestionn.syndromeType | getSyndromeType}}</p>
                            </el-col>
                        </el-row>
                        <el-table style="margin-top:10px;" border ref="multipleTable" v-if="currentSyTypeTable.length>0" :data="currentSyTypeTable" @selection-change="handleSelectionChange">>
                            <el-table-column v-if="!isReadOnly" label="选择" type="selection" width="55"></el-table-column>
                            <el-table-column label="预防癌症类型" prop="cancerType"></el-table-column>
                            <el-table-column label="筛查项目" prop="itemCheck"></el-table-column>
                            <el-table-column label="实施年龄"  prop="age"></el-table-column>
                            <el-table-column label="筛查频率" prop="frequency"></el-table-column>
                        </el-table>
                        <div v-if="referenceList.length>0" class="reference-list">
                            <p :key="index" v-for="(item,index) in referenceList">{{item.reference}}</p>
                        </div>
                        <p style="margin-top:20px;" v-if="referenceList.length == 0 && currentSyTypeTable.length == 0">目前无指南建议的筛查方案，请与您的临床医生取得联系。</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { familyTree } from "api/index.js";
import { setCookie, getCookie, delCookie } from "@/common/js/cookie.js";
import family from '@/components/familyTree'
export default { 
    name: "riskAssess", //遗传评估
    data(){
        return{
            letterList:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],
            isReadOnly:false,
            hiddenDom:true, //隐藏操作菜单
            familyTreeId:"",
            //数据结构部分开始
            person:{
                familyTreeId:"",
                name:"",
                sex:"",
                age:""
            },
            //家族史统计表
            tableData:[],
            //遗传风险评估
            syndromeRisk:"",
            syndromeModels:null,
            evaluateRet:{
                geneticRiskType:"",     //遗传风险
                geneticRiskList:[
                    {
                        geneJudge:"",   //1.遗传性肿瘤综合征判定
                        geneticMode:"", //2.遗传模式
                        geneticRate:""  //3.携带致病基因突变概率
                    }
                ]
            },
            //基因检测
            geneTest:{
                geneTestType:"",
                geneTestList:[
                    {
                        geneName:"", //基因
                        ransNum:"",  //转录本号
                        variationSite:"",//变异位点
                        funChange:"", //功能改变
                        funOther:"", //其他
                        mutType:""   //突变类型
                    }
                ]
            },
            //报告解读
            reportInterpre:"",
            //预防筛查建议
            suggestionn:{
                syndromeType:"",
                selectedList:[]
            },
            //数据结构部分结束

            //预防筛选建议开始
            currentSyTypeTable:[], //当前综合征类型表格
            referenceList:[],       //参考文献
              //遗传性乳腺癌卵巢癌综合征
            ycxrxalcazhz:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"女性乳腺癌",
                        itemCheck:"临床乳房检查",
                        age:"25岁",
                        frequency:"每6个月" 
                    },{
                        index:"1",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳腺MRI或乳房X光检查",
                        age:"20岁开始任选其一检测即可，30岁开始两项均检查，若有家族史按最早确诊年龄进行制定",
                        frequency:"每年" 
                    },{
                        index:"2",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳房自我检查",
                        age:"18岁",
                        frequency:"N/A" 
                    },{
                        index:"3",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳腺癌的化学预防（如他莫昔芬）",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"4",
                        cancerType:"女性乳腺癌",
                        itemCheck:"	考虑预防性乳房切除术",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"5",
                        cancerType:"男性乳腺癌",
                        itemCheck:"	乳房自我检查",
                        age:"35岁",
                        frequency:"每月" 
                    },{
                        index:"6",
                        cancerType:"男性乳腺癌",
                        itemCheck:"	乳房X光检查",
                        age:"40岁",
                        frequency:"" 
                    },{
                        index:"7",
                        cancerType:"男性乳腺癌",
                        itemCheck:"	临床乳房检查",
                        age:"35岁",
                        frequency:"每6-12个月" 
                    },{
                        index:"8",
                        cancerType:"卵巢癌",
                        itemCheck:"化学预防（如口服避孕药）",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"9",
                        cancerType:"卵巢癌",
                        itemCheck:"考虑双侧输卵管切除术",
                        age:"35-40岁，完成生育的女性，也可生育完或根据家族最早确诊年龄进行制定",
                        frequency:"N/A" 
                    },{
                        index:"10",
                        cancerType:"卵巢癌",
                        itemCheck:"经阴道超声检查、CA125 测定",
                        age:"30岁，根据家族最早确诊年龄进行制定",
                        frequency:"每6个月" 
                    },{
                        index:"11",
                        cancerType:"卵巢癌",
                        itemCheck:"超声内镜和 MRI、磁共振胰胆管成像",
                        age:"根据个人和家族史情况",
                        frequency:"N/A" 
                    },{
                        index:"12",
                        cancerType:"前列腺癌",
                        itemCheck:"前列腺癌筛查",
                        age:"40岁",
                        frequency:"每年" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Daly M et al. NCCN Clinical Practice Guidelines in Oncology®: Genetic/Familial High-Risk Assessment: Breast and Ovarian. V2.2017.Dec 07 2016. Available at http://www.nccn.org."
                    },{
                        reference:"[2] Daly M et al. NCCN Clinical Practice Guidelines in Oncology®: Genetic/Familial High-Risk Assessment: Breast and Ovarian. V1.2014. Feb 28. Available at http://www.nccn.org."
                    },{
                        reference:"[3] Canto MI et al. International Cancer of the Pancreas Screening (CAPS) Consortium summit on the management of patients with increased risk for familial pancreatic cancer. Gut. 2013;62:339-47."
                    }
                ]
            },
            //遗传性弥漫性胃癌
            ycxmmxwa:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"女性乳腺癌",
                        itemCheck:"临床乳房检查",
                        age:"35岁",
                        frequency:"每6个月" 
                    },{
                        index:"1",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳房 X 光检查和乳腺 MRI 检查",
                        age:"25岁",
                        frequency:"每年" 
                    },{
                        index:"2",
                        cancerType:"结直肠癌",
                        itemCheck:"	结肠镜检查",
                        age:"40岁或根据家族史中最早确诊年龄进行个体化制定	",
                        frequency:"每3-5年" 
                    },{
                        index:"3",
                        cancerType:"胃癌",
                        itemCheck:"	若有幽门螺旋杆菌感染，可进行相关治疗",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"4",
                        cancerType:"胃癌",
                        itemCheck:"	内窥镜检查和随机的活检，也可对可疑部位进行活检，直至可进行胃切除术",
                        age:"16岁",
                        frequency:"每年" 
                    },{
                        index:"5",
                        cancerType:"胃癌",
                        itemCheck:"	考虑胃切除术",
                        age:"20岁",
                        frequency:"N/A" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Fitzgerald RC et al. Hereditary diffuse gastric cancer: updated consensus guidelines for clinical management and directions for future research. J Med Genet. 2010;47(7):436-44."
                    },{
                        reference:"[2] Fitzgerald RC et al. International Gastric Cancer Linkage Consortium. Hereditary diffuse gastric cancer: updated consensus guidelines for clinical management and directions for future research. J Med Genet. 2010;47:436-44."
                    }
                ]
            },
            //李法美尼综合征
            lfmnzhz:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"女性乳腺癌",
                        itemCheck:"临床乳房检查",
                        age:"20-25岁",
                        frequency:"每6－12个月" 
                    },{
                        index:"1",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳腺MRI或乳房X光检查",
                        age:"20岁开始任选其一检测即可，30岁开始两项均检查，若有家族史按最早确诊年龄进行制定",
                        frequency:"每年" 
                    },{
                        index:"2",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳房自我检查",
                        age:"18岁",
                        frequency:"N/A" 
                    },{
                        index:"3",
                        cancerType:"女性乳腺癌",
                        itemCheck:"考虑预防性乳房切除术",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"4",
                        cancerType:"结直肠癌",
                        itemCheck:"结肠镜检查",
                        age:"不晚于25岁",
                        frequency:"每2-5年" 
                    },{
                        index:"5",
                        cancerType:"其他包括肾上腺皮质癌，肉瘤，脑肿瘤，白血病，淋巴瘤，和其他癌症，特别是那些有家族史的",
                        itemCheck:"全身体检和神经系统检查，并考虑器官靶向性监测。最好是在临床试验中考虑标准和新的筛选方式",
                        age:"儿童期，根据患者个体和家族史来个体化",
                        frequency:"每年" 
                    },{
                        index:"6",
                        cancerType:"其他包括胃癌、卵巢癌、子宫内膜癌、前列腺癌和胰腺癌",
                        itemCheck:"全身体检，并考虑器官靶向性监测。最好是在临床试验中考虑标准和新的筛选方式。",
                        age:"根据患者个体和家族史进行个体化制定",
                        frequency:"每年" 
                    },{
                        index:"7",
                        cancerType:"黑色素瘤",
                        itemCheck:"皮肤检查",
                        age:"个体化",
                        frequency:"每年" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Daly M et al. NCCN Clinical Practice Guidelines in Oncology®: Genetic/Familial High-Risk Assessment: Breast and Ovarian. V2.2017.Dec 07 2016. Available from http://www.nccn.org."
                    },{
                        reference:"[3] Schneider K, Garber J. Li-Fraumeni Syndrome. In: Pagon RA, et al., editors. GeneReviews. 2013 Available From http://www.ncbi.nlm.nih.gov/books/NBK1311/. PubMed PMID: 20301488."
                    }
                ]
            },
            //黑斑性息肉病
            hbxxrb:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"女性乳腺癌",
                        itemCheck:"临床乳房检查",
                        age:"20岁",
                        frequency:"每6－12个月" 
                    },{
                        index:"1",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳房X光检查和乳腺MRI检查",
                        age:"20-25岁",
                        frequency:"每年" 
                    },{
                        index:"2",
                        cancerType:"卵巢癌",
                        itemCheck:"腹腔检查",
                        age:"18-20岁",
                        frequency:"每年" 
                    },{
                        index:"3",
                        cancerType:"卵巢癌",
                        itemCheck:"阴道超声",
                        age:"18-20岁",
                        frequency:"每年" 
                    },{
                        index:"4",
                        cancerType:"胃癌",
                        itemCheck:"上消化道内镜检查",
                        age:"20岁",
                        frequency:"每2－3年" 
                    },{
                        index:"5",
                        cancerType:"结直肠癌",
                        itemCheck:"结肠镜检查",
                        age:"20岁",
                        frequency:"每2-3年" 
                    },{
                        index:"6",
                        cancerType:"胰腺癌",
                        itemCheck:"磁共振胰胆管造影和/或内镜超声",
                        age:"30－35岁",
                        frequency:"1-2年" 
                    },{
                        index:"7",
                        cancerType:"小肠癌",
                        itemCheck:"CT小肠造影可视化",
                        age:"以8-10岁为基准，不晚于18岁",
                        frequency:"18岁以后每2-3年" 
                    },{
                        index:"8",
                        cancerType:"睾丸癌",
                        itemCheck:"每年睾丸检查，观察女性化改变",
                        age:"10岁",
                        frequency:"每年" 
                    },{
                        index:"9",
                        cancerType:"子宫内膜癌",
                        itemCheck:"腹腔检查",
                        age:"18-20岁",
                        frequency:"每年" 
                    },{
                        index:"10",
                        cancerType:"子宫内膜癌",
                        itemCheck:"经阴道超声",
                        age:"18-20岁",
                        frequency:"每年" 
                    },{
                        index:"11",
                        cancerType:"头颈部癌",
                        itemCheck:"巴氏涂片",
                        age:"18-20岁",
                        frequency:"每年" 
                    },{
                        index:"12",
                        cancerType:"肺癌",
                        itemCheck:"普及症状或戒烟教育",
                        age:"按需",
                        frequency:"按需" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] McGarrity TJ et al. Peutz-Jeghers Syndrome. In: Pagon RA, et al. editors. GeneReviews. 2013. Available from http://www.ncbi.nlm.nih.gov/books/NBK1266/ PMID: 20301443."
                    },{
                        reference:"[2] Burt RW et al. NCCN Clinical Practice Guidelines in Oncology® Colorectal Cancer Screening. V1.2016.Jun 23. Available from http://www.nccn.org."
                    },{
                        reference:"[4] Provenzale D et al. NCCN Clinical Practice Gudelines in Oncology ®: Genetic/Familial High-Risk Assessment: Colorectal. V2.2016.Sep 26. Available from http://www.nccn.org."
                    },{
                        reference:"[5] Burt RW et al. NCCN Clinical Practice Guidelines in Oncology® Colorectal Cancer Screening. V2.2013. July 1. Available at http://www.nccn.org."
                    },{
                        reference:"[6] Canto MI et al. International Cancer of the Pancreas Screening (CAPS) Consortium summit on the management of patients with increased risk for familial pancreatic cancer. Gut. 2013;62(3):339-47."
                    }
                ]
            },
            //Cowden综合征
            cowdenzhz:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"女性乳腺癌",
                        itemCheck:"临床乳房检查",
                        age:"25岁",
                        frequency:"每6－12个月" 
                    },{
                        index:"1",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳房自我检查",
                        age:"18岁",
                        frequency:"每月" 
                    },{
                        index:"2",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳腺MRI和乳房X光检查",
                        age:"30-35岁开始，或根据家族中最早确诊年龄进行个体化制定",
                        frequency:"每年" 
                    },{
                        index:"3",
                        cancerType:"女性乳腺癌",
                        itemCheck:"考虑预防性乳房切除术",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"4",
                        cancerType:"结直肠癌",
                        itemCheck:"结肠镜检查",
                        age:"35岁",
                        frequency:"每5-10年" 
                    },{
                        index:"5",
                        cancerType:"子宫内膜癌",
                        itemCheck:"患者了解子宫内膜癌症状",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"6",
                        cancerType:"子宫内膜癌",
                        itemCheck:"考虑子宫切除术",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"7",
                        cancerType:"子宫内膜癌",
                        itemCheck:"考虑子宫内膜取样和阴道超声",
                        age:"30-35岁",
                        frequency:"每年" 
                    },{
                        index:"8",
                        cancerType:"其他－PHTS的非恶性特征",
                        itemCheck:"全身体检／必要时的皮肤科检查和治疗",
                        age:"18岁或家族中综合征 最早确诊年龄前5岁",
                        frequency:"每年" 
                    },{
                        index:"9",
                        cancerType:"甲状腺癌",
                        itemCheck:"甲状腺超声",
                        age:"18岁，或根据家族中最早确诊的年龄进行个体化制定",
                        frequency:"每年" 
                    },{
                        index:"10",
                        cancerType:"全身体检",
                        itemCheck:"全身体检／皮肤科检查和特别关注甲状腺癌表征和症状的普及教育",
                        age:"18岁，或根据家族中最早确诊的年龄进行个体化制定",
                        frequency:"每年" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Daly M et al. NCCN Clinical Practice Guidelines in Oncology®: Genetic/Familial High-Risk Assessment: Breast and Ovarian. V2.2017.Dec 07 2016. Available from http://www.nccn.org."
                    },{
                        reference:"[2] Eng C. PTEN Hamartoma Tumor Syndrome (PHTS). In: Pagon RA, et al., editors. GeneReviews. 2014 Available from http://www.ncbi.nlm.nih.gov/books/NBK1488/PubMed: 20301661."
                    }
                ]
            },
            //家族性腺瘤性息肉病
            jzxxlxxrb:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"结直肠癌",
                        itemCheck:"乙状结肠镜或全结肠镜检查",
                        age:"10-15岁",
                        frequency:"每年" 
                    },{
                        index:"1",
                        cancerType:"结直肠癌",
                        itemCheck:"根据肿瘤和/或息肉的数量和大小，考虑结直肠手术的评估和咨询",
                        age:"N／A",
                        frequency:"N／A" 
                    },{
                        index:"2",
                        cancerType:"结直肠癌",
                        itemCheck:"考虑用非甾体抗炎药的化学干预来减少腺瘤手术后的负担",
                        age:"N／A",
                        frequency:"N／A" 
                    },{
                        index:"3",
                        cancerType:"胃癌",
                        itemCheck:"上消化道内镜检查",
                        age:"25-30岁",
                        frequency:"每4年" 
                    },{
                        index:"4",
                        cancerType:"甲状腺癌",
                        itemCheck:"甲状腺检查或考虑超声检查",
                        age:"20岁开始",
                        frequency:"每年" 
                    },{
                        index:"5",
                        cancerType:"小肠癌",
                        itemCheck:"上消化道侧视内镜，可视化MRI或CT",
                        age:"25-30岁",
                        frequency:"每4年" 
                    },{
                        index:"6",
                        cancerType:"肝母细胞癌",
                        itemCheck:"考虑肝脏触诊，腹部超声，甲胎蛋白",
                        age:"婴儿期",
                        frequency:"出生5年内每3-6个月" 
                    },{
                        index:"7",
                        cancerType:"硬纤维瘤",
                        itemCheck:"腹部触诊和腹部MRI或CT",
                        age:"结肠切除术后1-3年",
                        frequency:"每5-10年或出现症状时" 
                    },{
                        index:"8",
                        cancerType:"中枢神经系统",
                        itemCheck:"体检",
                        age:"20岁",
                        frequency:"每年" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Provenzale D et al. NCCN Clinical Practice Guidelines in Oncology® Genetic/Familial High-Risk Assessment: Colorectal V2.2016. Sep 26. Available at http://www.nccn.org."
                    }
                ]
            },
            //MYH相关性息肉病
            myhxgxxrb:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"结直肠癌（双）",
                        itemCheck:"结肠镜检查",
                        age:"25-30岁",
                        frequency:"每2-3年" 
                    },{
                        index:"1",
                        cancerType:"结直肠癌（双）",
                        itemCheck:"考虑结直肠手术的评估和咨询",
                        age:"根据癌症诊断和/或腺瘤数量、大小和组织学来定",
                        frequency:"N/A" 
                    },{
                        index:"2",
                        cancerType:"小肠癌（双）",
                        itemCheck:"上消化道侧视内镜",
                        age:"30-35岁",
                        frequency:"每4年" 
                    },{
                        index:"3",
                        cancerType:"结直肠癌（单）",
                        itemCheck:"目前暂无该风险人群的医学管理措施，可结合家族史并遵循普通人群的筛查手段",
                        age:"个体化",
                        frequency:"N/A" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Provenzale D et al. NCCN Clinical Practice Guidelines in Oncology® Genetic/Familial High-Risk Assessment: Colorectal V2.2016. Sep 26. Available at http://www.nccn.org"
                    },
                    {
                        reference:"[2] Burt RW et al. NCCN Clinical Practice Guidelines in Oncology® Colorectal Cancer Screening. V1.2016.Jun 23. Available from http://www.nccn.org."
                    }
                ]
            },
            //林奇综合征
            lqzhz:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"结直肠癌",
                        itemCheck:"结肠镜检查",
                        age:"20-25岁，若家族成员中有确诊年龄小于25岁者，可提前2-5年开始",
                        frequency:"每1-2年" 
                    },{
                        index:"1",
                        cancerType:"结直肠癌",
                        itemCheck:"直肠内窥镜检查",
                        age:"20-25岁",
                        frequency:"每1-2年" 
                    },{
                        index:"2",
                        cancerType:"结直肠癌",
                        itemCheck:"发现息肉后经病理学确认，应考虑内镜息肉切除术",
                        age:"N/A",
                        frequency:"N/A" 
                    },{
                        index:"3",
                        cancerType:"结直肠癌",
                        itemCheck:"诊断为结直肠癌后，推荐全结肠切除术",
                        age:"N/A",
                        frequency:"N/A" 
                    },{
                        index:"4",
                        cancerType:"结直肠癌",
                        itemCheck:"常规体检，包括神经和皮肤检查",
                        age:"18岁后",
                        frequency:"每年" 
                    },{
                        index:"5",
                        cancerType:"卵巢癌",
                        itemCheck:"考虑 双侧输卵管－卵巢切除术",
                        age:"生育后",
                        frequency:"N/A" 
                    },{
                        index:"6",
                        cancerType:"卵巢癌",
                        itemCheck:"考虑经阴道超声检查和CA－125检测",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"7",
                        cancerType:"胃癌",
                        itemCheck:"上消化道内镜检查",
                        age:"30-35岁，尤其是有其他风险因素如家族史或亚洲血统的患者",
                        frequency:"每3-5年" 
                    },{
                        index:"8",
                        cancerType:"胰腺癌",
                        itemCheck:"超声内镜和 MRI、磁共振胰胆管成像",
                        age:"根据个人和家族史情况",
                        frequency:"N/A" 
                    },{
                        index:"9",
                        cancerType:"子宫内膜癌",
                        itemCheck:"考虑子宫内膜取样和阴道超声",
                        age:"个体化",
                        frequency:"每年" 
                    },{
                        index:"10",
                        cancerType:"子宫内膜癌",
                        itemCheck:"考虑子宫切除术",
                        age:"生育后",
                        frequency:"N/A" 
                    },{
                        index:"11",
                        cancerType:"输尿管／肾盂癌",
                        itemCheck:"尿检",
                        age:"25-30岁",
                        frequency:"每年" 
                    },{
                        index:"12",
                        cancerType:"小肠癌",
                        itemCheck:"上消化道内镜检查",
                        age:"30-35岁，尤其是有其他风险因素如家族史或亚洲血统的患者",
                        frequency:"每3-5年" 
                    },{
                        index:"13",
                        cancerType:"中枢神经系统",
                        itemCheck:"常规体检",
                        age:"25－30岁",
                        frequency:"	每年" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Provenzale D et al. NCCN Clinical Practice Guidelines in Oncology® Genetic/Familial High-Risk Assessment: Colorectal V2.2016. Sep 26. Available at http://www.nccn.org."
                    },
                    {
                        reference:"[2] Canto MI et al. International Cancer of the Pancreas Screening (CAPS) Consortium summit on the management of patients with increased risk for familial pancreatic cancer. Gut. 2013;62:339-47."
                    }
                ]
            },
            //幼年性息肉病
            ynxxrb:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"结直肠癌",
                        itemCheck:"结肠镜检查",
                        age:"15岁",
                        frequency:"每2-3年" 
                    },{
                        index:"1",
                        cancerType:"结直肠癌",
                        itemCheck:"监测直肠出血或贫血，如果发现症状可提前进行监测",
                        age:"15岁",
                        frequency:"N/A" 
                    },{
                        index:"2",
                        cancerType:"胃癌",
                        itemCheck:"上消化道内镜检查",
                        age:"15岁",
                        frequency:"每2-3年" 
                    },{
                        index:"3",
                        cancerType:"其他－遗传性出血性毛细血管扩张症",
                        itemCheck:"建议多重筛查，包括脑部MRI、对比超声心动图检查，胸部CT",
                        age:"推荐婴儿期做（前6个月）",
                        frequency:"每种不同" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Provenzale D et al. NCCN Clinical Practice Gudelines in Oncology ®: Genetic/Familial High-Risk Assessment: Colorectal. V2.2016.Sep 26. Available from http://www.nccn.org."
                    },{
                        reference:"[2] Larsen Haidle J et al. Juvenile Polyposis Syndrome. In: Pagon RA, et al. editors. GeneReviews. 2015 Available from http://www.ncbi.nlm.nih.gov/books/NBK1469/. PMID: 20301642."
                    },{
                        reference:"[3] Burt RW et al. NCCN Clinical Practice Guidelines in Oncology® Colorectal Cancer Screening. V1.2016.Jun 23. Available from http://www.nccn.org."
                    },{
                        reference:"[4] McDonald J et al. Hereditary Hemorrhagic Telangiectasia. In: Pagon RA, et al., editors. GeneReviews. 2014 Available from http://www.ncbi.nlm.nih.gov/books/NBK1351/."
                    },{
                        reference:"[5] McDonald J, et al. Hereditary hemorrhagic telangiectasia: an overview of diagnosis, management, and pathogenesis. Genet Med. 2011 13:607-16."
                    }
                ]
            },
            //遗传性多发性黑色素瘤
            ycxdfxhssl:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"胰腺癌",
                        itemCheck:"根据个人和家族史情况，开始实施超声内镜和 MRI、磁共振胰胆管成像",
                        age:"个体化",
                        frequency:"N/A" 
                    },{
                        index:"1",
                        cancerType:"黑色素瘤",
                        itemCheck:"根据患者或家族成员的患病情况制定全身皮肤检查计划",
                        age:"10岁",
                        frequency:"每月" 
                    },{
                        index:"2",
                        cancerType:"黑色素瘤",
                        itemCheck:"临床皮肤检查（全身皮肤医学摄影和非典型痣的局部摄影）",
                        age:"10岁",
                        frequency:"每6-12个月" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Canto MI et al. International Cancer of the Pancreas Screening (CAPS) Consortium summit on the management of patients with increased risk for familial pancreatic cancer. Gut. 2013;62:339-47."
                    },{
                        reference:"[2] Kefford RF et al. Counseling and DNA testing for individuals perceived to be genetically predisposed to melanoma: A consensus statement of the Melanoma Genetics Consortium. J Clin Oncol. 1999:3245-51."
                    },{
                        reference:"[3] Coit DG et al. NCCN Clinical Practice Guidelines in Oncology®: Melanoma. V 2.2013. October 17. Available at http://www.nccn.org."
                    },{
                        reference:"[4] Vasen HF et al. Risk of developing pancreatic cancer in families with familial atypical multiple mole melanoma associated with a specific 19 deletion of p16 (p16-Leiden). Int J Cancer. 2000:809-11."
                    }
                ]
            },
            //共济失调性毛细血管扩张症
            gjstxmxxgkzz:{
                tableList:[
                    {
                        index:"0",
                        cancerType:"女性乳腺癌",
                        itemCheck:"	乳房自查",
                        age:"结合自身和家族情况实施",
                        frequency:"" 
                    },{
                        index:"1",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳房 X 光检查和乳腺 MRI 检查",
                        age:"30岁",
                        frequency:"每年" 
                    },{
                        index:"2",
                        cancerType:"女性乳腺癌",
                        itemCheck:"乳房临床检查",
                        age:"30岁",
                        frequency:"每6-12个月" 
                    },{
                        index:"3",
                        cancerType:"胰腺癌",
                        itemCheck:"根据个人和家族史情况，开始实施超声内镜和 MRI、磁共振胰胆管成像",
                        age:"个体化",
                        frequency:"N/A" 
                    }
                ],
                referenceList:[
                    {
                        reference:"[1] Daly M et al. NCCN Clinical Practice Guidelines in Oncology®: Genetic/Familial High-Risk Assessment: Breast and Ovarian. V2.2017.Dec 07 2016. Available from http://www.nccn.org."
                    },{
                        reference:"[2] Bevers TB, et al. NCCN Clinical Practice Guidelines in Oncology®: Breast Cancer Screening and Diagnosis. V1.2016. Jul 27. Available from http://www.nccn.org."
                    },{
                        reference:"[3] Canto MI, et al. International Cancer of the Pancreas Screening (CAPS) Consortium summit on the management of patients with increased risk for familial pancreatic cancer. Gut. 2013;62:339-47."
                    },{
                        reference:"[4]Gatti R. Ataxia-Telangiectasia. In: Pagon RA, et al., editors. GeneReviews. 2010 Available from http://www.ncbi.nlm.nih.gov/books/NBK26468/.PMID:20301790."
                    }
                ]
            },
            //Bloom综合征
            bloomzhz:{
                tableList:[],
                referenceList:[]
            },
            //锯齿状息肉病
            jczxrl:{
                tableList:[],
                referenceList:[]
            },
            //基底细胞痣样综合征
            jcxbzyzhz:{
                tableList:[],
                referenceList:[]
            },
            //遗传性前列腺癌
            ycxqlxa:{
                tableList:[],
                referenceList:[]
            },
            //Carney综合征
            carneyzhz:{
                tableList:[],
                referenceList:[]
            },
            //多发性内分泌腺瘤病II型
            dfxnfmxlbiix:{
                tableList:[],
                referenceList:[]
            },
            //遗传性副神经节瘤
            ycxfsjjl:{
                tableList:[],
                referenceList:[]
            },
            //甲状腺非髓样癌
            jzxfsyl:{
                tableList:[],
                referenceList:[]
            },
            //结节性硬化症
            jjxyhz:{
                tableList:[],
                referenceList:[]
            },
            //成年早老症
            cnzlz:{
                tableList:[],
                referenceList:[]
            },
            //Birt–Hogg– Dubé综合征
            birtHoggDubezhz:{
                tableList:[],
                referenceList:[]
            },
            //遗传性肾细胞癌与平滑肌瘤
            ycxsxblyphjl:{
                tableList:[],
                referenceList:[]
            },
            //横纹肌样易感综合征
            hwjyygzhz:{
                tableList:[],
                referenceList:[]
            },
            //VHL综合征
            vhlzhz:{
                tableList:[],
                referenceList:[]
            },
            //遗传性乳头状肾细胞癌
            ycxrtzsxba:{
                tableList:[],
                referenceList:[]
            },
            //神经纤维瘤病I型
            sjxwlbix:{
                tableList:[],
                referenceList:[]
            }
            //预防筛选建议结束
        }
    },
    methods:{
        //添加综合征
        addSyn(){
            var obj={
                geneJudge:"",   //1.遗传性肿瘤综合征判定
                geneticMode:"", //2.遗传模式
                geneticRate:""  //3.携带致病基因突变概率
            };
            this.evaluateRet.geneticRiskList.push(obj);
        },
        //删除综合征
        delet(index){
            this.evaluateRet.geneticRiskList.splice(index,1);
        },
        //添加检测结果
        addgeneTest(){
            var obj={
                geneName:"", //基因
                ransNum:"",  //转录本号
                variationSite:"",//变异位点
                funChange:"", //功能改变
                funOther:"",
                mutType:""   //突变类型
            };
            this.geneTest.geneTestList.push(obj);
        },
        //删除基因检测
        deletGeneTest(index){
            this.geneTest.geneTestList.splice(index,1);
        },
        //改变综合征类型
        changeSyType(type){
            if(type == 1){
                this.currentSyTypeTable = this.ycxrxalcazhz.tableList;
                this.referenceList = this.ycxrxalcazhz.referenceList;
            }else if(type == 2){
                this.currentSyTypeTable = this.ycxmmxwa.tableList;
                this.referenceList = this.ycxmmxwa.referenceList;
            }else if(type == 3){  
                this.currentSyTypeTable = this.lfmnzhz.tableList;
                this.referenceList = this.lfmnzhz.referenceList;
            }else if(type == 4){
                this.currentSyTypeTable = this.hbxxrb.tableList;
                this.referenceList = this.hbxxrb.referenceList;
            }else if(type == 5){
                this.currentSyTypeTable = this.cowdenzhz.tableList;
                this.referenceList = this.cowdenzhz.referenceList;   
            }else if(type == 6){
                this.currentSyTypeTable = this.jzxxlxxrb.tableList;
                this.referenceList = this.jzxxlxxrb.referenceList;  
            }else if(type == 7){
                this.currentSyTypeTable = this.myhxgxxrb.tableList;
                this.referenceList = this.myhxgxxrb.referenceList;  
            }else if(type == 8){
                this.currentSyTypeTable = this.lqzhz.tableList;
                this.referenceList = this.lqzhz.referenceList;  
            }else if(type == 9){
                this.currentSyTypeTable = this.ynxxrb.tableList;
                this.referenceList = this.ynxxrb.referenceList;  
            }else if(type == 10){
                this.currentSyTypeTable = this.ycxdfxhssl.tableList;
                this.referenceList = this.ycxdfxhssl.referenceList;  
            }else if(type == 11){
                this.currentSyTypeTable = this.gjstxmxxgkzz.tableList;
                this.referenceList = this.gjstxmxxgkzz.referenceList;  
            }else if(type == 12){
                this.currentSyTypeTable = this.bloomzhz.tableList;
                this.referenceList = this.bloomzhz.referenceList; 
            }else if(type == 13){
                this.currentSyTypeTable = this.jczxrl.tableList;
                this.referenceList = this.jczxrl.referenceList; 
            }else if(type == 14){
                this.currentSyTypeTable = this.jcxbzyzhz.tableList;
                this.referenceList = this.jcxbzyzhz.referenceList; 
            }else if(type == 15){
                this.currentSyTypeTable = this.ycxqlxa.tableList;
                this.referenceList = this.ycxqlxa.referenceList; 
            }else if(type == 16){
                this.currentSyTypeTable = this.carneyzhz.tableList;
                this.referenceList = this.carneyzhz.referenceList; 
            }else if(type == 17){
                this.currentSyTypeTable = this.dfxnfmxlbiix.tableList;
                this.referenceList = this.dfxnfmxlbiix.referenceList;
            }else if(type == 18){
                this.currentSyTypeTable = this.ycxfsjjl.tableList;
                this.referenceList = this.ycxfsjjl.referenceList;
            }else if(type == 19){
                this.currentSyTypeTable = this.jzxfsyl.tableList;
                this.referenceList = this.jzxfsyl.referenceList;
            }else if(type == 20){
                this.currentSyTypeTable = this.jjxyhz.tableList;
                this.referenceList = this.jjxyhz.referenceList;
            }else if(type == 21){
                this.currentSyTypeTable = this.cnzlz.tableList;
                this.referenceList = this.cnzlz.referenceList;
            }else if(type == 22){
                this.currentSyTypeTable = this.birtHoggDubezhz.tableList;
                this.referenceList = this.birtHoggDubezhz.referenceList;
            }else if(type == 23){
                this.currentSyTypeTable = this.ycxsxblyphjl.tableList;
                this.referenceList = this.ycxsxblyphjl.referenceList;
            }else if(type == 24){  
                this.currentSyTypeTable = this.hwjyygzhz.tableList;
                this.referenceList = this.hwjyygzhz.referenceList;
            }else if(type == 25){  
                this.currentSyTypeTable = this.vhlzhz.tableList;
                this.referenceList = this.vhlzhz.referenceList;
            }else if(type == 26){  
                this.currentSyTypeTable = this.ycxrtzsxba.tableList;
                this.referenceList = this.ycxrtzsxba.referenceList;
            }else if(type == 27){  
                this.currentSyTypeTable = this.sjxwlbix.tableList;
                this.referenceList = this.sjxwlbix.referenceList;
            }
            
            this.suggestionn.selectedList = [];
        },
        //设置所选中的表格行
        setSelect(list){     
            var that =this;
            if(list && list.length>0){
                list.forEach(index=>{
                    that.$refs.multipleTable.toggleRowSelection(this.currentSyTypeTable[index]);
                }, this);
            }
        },
        //当表格选择 发生变化时
        handleSelectionChange(value){
            this.suggestionn.selectedList=[];
            for(var i=0;i<value.length;i++){
                this.suggestionn.selectedList.push(value[i].index);
            }
        },
        //获取遗传风险评估表
        getGeneticRisk(){
            let obj ={
                familyTreeId : this.familyTreeId
            }
            familyTree.geneticRisk(obj).then((res) => {
                if(res.returnCode == 0 || res.returnCode == 200){
                    if(res.data && res.data.geneticEvaluationResponse && res.data.geneticEvaluationResponse.syndromeModels){
                        this.syndromeRisk =  res.data.geneticEvaluationResponse.risk;
                        this.syndromeModels = res.data.geneticEvaluationResponse.syndromeModels;
                    }
                    if(res.data && res.data.familyTree && res.data.familyTree.familyTree){
                        let obj={
                            familyTreeId:res.data.familyTree.id,
                            name:res.data.familyTree.familyTree.name,
                            sex:res.data.familyTree.familyTree.sex,
                            age:""
                        }
                        this.person = obj;
                    }
                    if(res.data && res.data.fanliyList && res.data.fanliyList.length>0){
                        //获取家族史信息
                        this.tableData = this.getFamilyData(res.data.fanliyList);
                    }
                    if(res.data && res.data.genetic && res.data.genetic.familyGenetic){
                        this.evaluateRet = res.data.genetic.familyGenetic.evaluateRet;
                        this.geneTest = res.data.genetic.familyGenetic.geneTest;
                        this.reportInterpre = res.data.genetic.familyGenetic.reportInterpre;
                        this.suggestionn = res.data.genetic.familyGenetic.suggestionn;
                        //回显数据
                        this.doShowData();
                    }
                }
                console.log(res);
            })
        },
        //保存遗传风险评估
        saveGeneTicRisk(){
            let genetic = this.getGenetic();
            let obj={
                familyGenetic:genetic,
                familyTreeId:this.familyTreeId,
                userId:getCookie("userid"),
                patientid:"",
            }
            familyTree.saveGeneTicRisk(obj).then((res) => {
                if(res.returnCode == 0 || res.returnCode == 200){
                    this.$Message.success("保存"+res.msg);
                }else{
                    this.$Message.error(res.msg);
                }
            })
        },
        //获取保存遗传风险评估所需数据
        getGenetic(){
            var obj={
                evaluateRet : this.evaluateRet,
                geneTest : this.geneTest,
                reportInterpre : this.reportInterpre,
                suggestionn : this.suggestionn
            }
            return obj;
        },
        //回显
        doShowData(){
            let list = this.suggestionn.selectedList;
            this.changeSyType(this.suggestionn.syndromeType);
            this.suggestionn.selectedList = list;
            if(this.isReadOnly){
                var ret = [];
                for(var i=0;i<this.suggestionn.selectedList.length;i++){
                    ret.push(this.currentSyTypeTable[this.suggestionn.selectedList[i]]);
                }
                ret.sort();
                this.currentSyTypeTable = ret;
                if(ret.length <= 0){
                    this.referenceList = [];
                }  
            }else{
                var that = this;
                setTimeout(function(){
                    that.setSelect(that.suggestionn.selectedList);
                },0)
                
            } 
        },
        //从返回数据里 获取家族史信息
        getFamilyData(list){
            let ret = [];
            for(var i=0;i<list.length;i++){
                if(list[i].cancer && list[i].cancer.length>0){
                    for(var k=0; k<list[i].cancer.length; k++){
                        let c = list[i].cancer[k];
                        if(c.id && c.id!="affected"){
                            let obj={
                                name : list[i].firstName ? list[i].firstName : "",
                                kinshipLevel : this.getkinshipLevel(list[i]),
                                pedigree : list[i].precursor == 1 ? "" : list[i].Family_type,
                                cancer : c.name,
                                age : c.age,
                                genes:c.genes?c.genes:[],
                            }
                            ret.push(obj);
                        }  
                    }
                }
            }
            return ret;
        },
        //获取家属级别
        getkinshipLevel(obj){
            let ret = "";
            if(obj.precursor == 1 || obj.kinship_num == 0){
                ret = "先证者"
            }else if(obj.kinship_num == 1){
                ret = "1级亲属";
            }else if(obj.kinship_num == 2){
                ret = "2级亲属";
            }else if(obj.kinship_num == 3){
                ret = "3级亲属";
            }
            return ret;
        }
    },
    filters:{
        //只读状态下 遗传风险选择
        getGeneticRiskType(type){
            switch (type) {
                case "1":
                    return "高风险";
                    break;
                case "2":
                    return "中等风险";
                    break;
                case "3":
                    return "低风险"
                    break;
                default:
                    return "";
                    break;
            }
        },
        //只读状态下 遗传模式选择
        getGeneticMode(type){
            switch (type) {
                case "1":
                    return "常染色体显性遗传";
                    break;
                case "2":
                    return "常染色体隐性遗传";
                    break;
                case "3":
                    return "X染色体连锁显性遗传"
                    break;
                case "4":
                    return "X染色体连锁隐性遗传"
                    break;
                case "5":
                    return "Y染色体连锁遗传"
                    break;
                case "6":
                    return "复杂遗传模式"
                    break;
                default:
                    return "";
                    break;
            }
        },
        //只读状态下 检测类型
        getGeneTestType(type){
            switch (type) {
                case "1":
                    return "panel检测";
                    break;
                case "2":
                    return "sanger测序";
                    break;
                case "3":
                    return "MLPA"
                    break;
                case "4":
                    return "全外显子"
                    break;
                default:
                    return "";
                    break;
            }
        },
        //只读状态下 功能改变
        getFunCHange(type){
            switch (type) {
                case "1":
                    return "错义突变";
                    break;
                case "2":
                    return "无义突变";
                    break;
                case "3":
                    return "移码突变"
                    break;
                case "4":
                    return "同义突变"
                    break;
                case "5":
                    return "剪接位点突变"
                    break;
                case "6":
                    return "其他"
                    break;
            } 
        },
        //只读状态下 突变类型
        getMutType(type){
            switch (type) {
                case "1":
                    return "致病的";
                    break;
                case "2":
                    return "可能致病的";
                    break;
                case "3":
                    return "意义不明确的"
                    break;
                case "4":
                    return "可能良性的"
                    break;
                case "5":
                    return "良性的"
                    break;
            } 
        },
        //只读状态下 综合征类型
        getSyndromeType(type){
            switch (type) {
                case "1":
                    return "遗传性乳腺癌卵巢癌综合征";
                    break;
                case "2":
                    return "遗传性弥漫性胃癌";
                    break;
                case "3":
                    return "李法美尼综合征"
                    break;
                case "4":
                    return "黑斑性息肉病"
                    break;
                case "5":
                    return "Cowden综合征"
                    break;
                case "6":
                    return "家族性腺瘤性息肉病"
                    break;
                case "7":
                    return "MYH相关性息肉病"
                    break;
                case "8":
                    return "林奇综合征"
                    break;
                case "9":
                    return "幼年性息肉病"
                    break;
                case "10":
                    return "遗传性多发性黑色素瘤"
                    break;
                case "11":
                    return "共济失调性毛细血管扩张症"
                    break;
                case "12":
                    return "Bloom综合征"
                    break;
                case "13":
                    return "锯齿状息肉病"
                    break;
                case "14":
                    return "基底细胞痣样综合征"
                    break;
                case "15":
                    return "遗传性前列腺癌"
                    break;
                case "16":
                    return "Carney综合征"
                    break;
                case "17":
                    return "多发性内分泌腺瘤病II型"
                    break;
                case "18":
                    return "遗传性副神经节瘤"
                    break;
                case "19":
                    return "甲状腺非髓样癌"
                    break;
                case "20":
                    return "结节性硬化症"
                    break;
                case "21":
                    return "成年早老症"
                    break;
                case "22":
                    return "Birt–Hogg– Dubé综合征"
                    break;
                case "23":
                    return "遗传性肾细胞癌与平滑肌瘤"
                    break;
                case "24":
                    return "横纹肌样易感综合征"
                    break;
                case "25":
                    return "VHL综合征"
                    break;
                case "26":
                    return "遗传性乳头状肾细胞癌"
                    break;
                case "27":
                    return "神经纤维瘤病I型"
                    break;
            } 
        }
    },
    components: {
        family
    },
    mounted() {
        this.isReadOnly = M.url().ediType && M.url().ediType == "1" ? false : true;
        this.familyTreeId =  M.url().familyTreeId ? M.url().familyTreeId : "";

        this.getGeneticRisk();
    }
}
</script>


